package com.example.todolist.util;

import com.example.todolist.common.QiniuConstants;
import com.qiniu.util.Auth;
import com.qiniu.util.StringMap;

/**
 * @Email: m15602498163@163.com
 * @Author: yoonada
 * @Date: 2020/9/15
 * @Time: 10:58 上午
 * @Msg: 七牛云工具类
 */
public class QiniuUtil {

    /**
     * 获取七牛云上传token
     * @return
     */
    public static String getUpLoadToken(){
        Auth auth = Auth.create(QiniuConstants.ACCESS_KEY, QiniuConstants.SECRET_KEY);
        StringMap putPolicy = new StringMap();
        return auth.uploadToken(QiniuConstants.BUCKET,null,3600,putPolicy);
    }

}
